package itheima.d07;

import java.util.Arrays;

public class Test {

    public static void test(int ...  a){
        System.out.println(a.length);
        System.out.println(Arrays.toString( a));
    }


    public static void sum( int ...a){
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            sum += a[i];
        }
        System.out.println(sum);

    }
    public static void main(String[] args) {
        test();
        test(1);
        test(1,2);
        test(1,2,3);
        test(1,2,3,4);
        test(1,2,3,4,5);
        test(1,2,3,4,5,6);

        sum(1,2,3,4,5,6);



    }
}
